Skip to content

fix: use last resumed event timestamp for 'running for' calculation#328

Merged
ben-fornefeld merged 2 commits into
mainfrom
devin/1778773127-fix-running-for-paused-sandboxes
May 14, 2026
Merged

fix: use last resumed event timestamp for 'running for' calculation#328
ben-fornefeld merged 2 commits into
mainfrom
devin/1778773127-fix-running-for-paused-sandboxes

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

When a sandbox has been paused and then resumed, the "running for" field in the sandbox details header was incorrectly calculating duration from the creation timestamp. This meant it included the paused time in the displayed duration.

This fix looks up the last sandbox.lifecycle.resumed event from the lifecycle events array and uses its timestamp as the start for the "running for" calculation. If no resumed event exists (sandbox was never paused), it falls back to the original createdAt timestamp.

Review & Testing Checklist for Human

  • Open a sandbox that has been paused and then resumed — verify the "running for" field shows time since last resume, not since creation
  • Open a sandbox that has never been paused — verify "running for" still shows time since creation (no regression)
  • Open a killed sandbox that was previously paused/resumed — verify "ran for" shows duration from last resume to kill time

Notes

The change is isolated to src/features/dashboard/sandbox/header/ran-for.tsx. The events array used is the same one already available in the sandbox lifecycle context and used by the monitoring charts.

Link to Devin session: https://app.devin.ai/sessions/ff633b5c68c846719d63d51498cedc2d

When a sandbox has been paused and resumed, the 'running for' field now
uses the last 'resumed' event timestamp instead of the creation timestamp,
so the displayed duration reflects time since the most recent resume rather
than total time since creation.

Co-Authored-By: ben@e2b.dev <ben@e2b.dev>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@cla-bot cla-bot Bot added the cla-signed label May 14, 2026
@vercel

vercel Bot commented May 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment May 14, 2026 3:48pm
web-juliett Ready Ready Preview, Comment May 14, 2026 3:48pm

Request Review

@ben-fornefeld ben-fornefeld merged commit d1c5552 into main May 14, 2026
14 of 15 checks passed
@ben-fornefeld ben-fornefeld deleted the devin/1778773127-fix-running-for-paused-sandboxes branch May 14, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant